<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>淘宝网 - 淘! 我喜欢</title>
    <link rel="stylesheet" type="text/css" href="../css/header.css" />
    <link rel="stylesheet" type="text/css" href="../css/footer.css" />
    <link rel="stylesheet" type="text/css" href="../css/regiest.css" />
    <link rel="stylesheet" type="text/css" href="../css/base-clear.css" />
</head>
<body>
    <div class="header-container"></div>
    <div class="img">
            <img src="../img/regiest/1.jpg">
    </div>
   <div class="main1">
       <div class="main">
            <form>
                <div class="username">
                    <span>手机号码</span>
                    <input type="text" placeholder="请输入你的手机号" class="clearInput"/>
                </div>
                <div class="username userpwd">
                    <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;密码</span>
                    <input type="password" placeholder="密码" class="clearInput"/>
                </div>
                <div class="btn">
                    <input type="button" value="注册" style="font-size: 16px; color:white" class="clearInput"/>
                </div>
            </form>
            <div class="xieyi">
                <input type="checkbox">已阅读并同意一下协议
                <a href="http://127.0.0.1:2113/html/attention.html">淘宝平台服务协议</a>
                <a href="#">隐私权政策</a>
                <a href="#">法律声明</a>
                <a href="#">支付宝及客服端服务协议</a>
            </div>
       </div>
       <div class="footer1">
            <div class="uli">
                <ul>
                    <li><a href="#">阿里巴巴集团</a></li>
                    <li><a href="#">阿里巴巴国际站</a></li>
                    <li><a href="#">阿里巴巴中国站</a></li>
                    <li><a href="#">全球速卖通</a></li>
                    <li><a href="#">淘宝网</a></li>
                    <li><a href="#">天猫</a></li>
                    <li><a href="#">聚划算</a></li>
                    <li><a href="#">一淘</a></li>
                    <li><a href="#">阿里妈妈</a></li>
                    <li><a href="#">阿里云计算</a></li>
                    <li><a href="#">云OS</a></li>
                    <li><a href="#">万网</a></li>
                    <li><a href="#" class="a2">支付宝</a></li>
                </ul>
            </div>
            <div class="bottom">
                <ul>
                    <li><a href="#">关于淘宝</a></li>
                    <li><a href="#">合作伙伴</a></li>
                    <li><a href="#">营销中心</a></li>
                    <li><a href="#">联系客服</a></li>
                    <li><a href="#">开放平台</a></li>
                    <li><a href="#">成征英才</a></li>
                    <li><a href="#">联系我们</a></li>
                    <li><a href="#">网站地图</a></li>
                    <li><a href="#">法律声明及隐私权政策</a></li>
                    <li><p>&copy;2022Taobao.com版权所有</p></li>
                </ul>
            </div>
            <div class="bot">
                <ul>
                    <li>
                        <p>网络文化经营许可证:<a href="#">文网文[2010]040号</a></p>
                    </li>
                    <li>
                        <p>增值电信业务经营许可证：浙B2-20080224-1</p>
                    </li>
                    <li>
                        <p>信息网络传播视听节目许可证：1109364号</p>
                    </li>
                </ul>
            </div>
       </div>
   </div>
   
   <div class="footer-container"></div>
   <script src="../libs/jquery.min.js"></script>
   <script src="../libs/require.js"></script>

   <script>
       $('.header-container').load('./header.html', function () {
       })
       $('.footer-container').load('./footer.html')
   </script>
   <script>

    let user = document.querySelector('input[type=text]')
    let pass = document.querySelector('input[type=password]')
    let btn = document.querySelector('input[type=button]')
    let ckd = document.querySelector('input[type=checkbox]')
    btn.onclick =function(){
        let user1= user.value
        let pass1 = pass.value
        if(user1 == '' || pass1 == ''){
            alert('请输入账号或密码')
            return
        }else{
            let phone = /^1\d{10}$/
            if(!phone.test(user1)){
                alert('手机号码式不正确')
                return
            }
            let mima=  /^.{6,}$/
            if(!mima.test(pass1)){
                alert('请输入6-12位的密码')
                return
            }
            let user = JSON.parse(localStorage.getItem('userInfo')) || []
            let obj = {}
            obj.name= user1
            obj.password = pass1
            // console.log(obj);
            if(user.some((item)=>{return item.name === obj.name})){
                alert('用户名已存在')
                return
            }else{
                user.push(obj)
                localStorage.setItem('userInfo',JSON.stringify(user))
                alert('注册成功')
                location.href = '../html/login.html'
            }
        }
    }
   

   </script>
</body>
</html>